package ogmios.components;
import java.util.*;
import java.io.*;
/**
 * A file filter that will match any file that has one of the given filters, and directories, regardless of whether they match a filter.
 */
public class MultiOgmiosFilter extends OgmiosFilter
{
 public final Set<String> filters;
 public MultiOgmiosFilter(Set<String> filters, String extension, String filterDescription)
 {
  super(extension, filterDescription);
  this.filters = filters;
 }
 public boolean accept(File f)
 {
   if (f.isDirectory())
     return true;
   String name = f.getName().toLowerCase();
   int i = name.lastIndexOf(".");

   return i == -1 ? false : filters.contains(name.substring(i));
  }
}